package com.neu.system.controller;

import com.neu.system.service.IMqttService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/mqtt")
public class MqttTestController {

    @Autowired
    private IMqttService mqttService;

    /**
     * 发送指令到板子
     * 示例：POST /mqtt/send?command=Switch1
     */
    @PostMapping("/send")
    public String sendCommand(@RequestParam String command) {
        mqttService.sendCommand(command);
        return "已发送指令: " + command;
    }
} 